<% layout('layout') %><!--加载全局布局文件-->
<!--在这里编写你的代码-->
<!--轮播图-->
<div ng-controller="DetailCtrl" ng-cloak class="ng-cloak">
<div data-am-widget="slider" class="am-slider am-slider-a1 " data-am-slider='{"directionNav":false}'>
    <% if(picurlarray.length){%>
    <ul class="am-slides">
        <% picurlarray.forEach(function(item){%>
        <li>
            <img src="<%= item%>">
        </li>
        <% });%>
    </ul>
    <% }%>
</div>

<!--基本详情-->

<div  class="Nicolas-baseinfo am-padding-0">
    <div class="am-margin-sm" >
        <span class="">
            <%= product.get('intro') %>
        </span>
    </div>
    <div class="am-margin-sm" style="margin-bottom: 0px;padding-bottom: 0px;">
        <span class="am-fl ">规格:</span>
        <div class=""  data-am-button1 style="top: -5px;position: relative;overflow: hidden">
            <% var rows = 0;for(var i in spec){ rows++; if(rows == 1){
                var price = spec[i]['grprice'];
                var inventory = isNaN(spec[i]['inventory'])?0:spec[i]['inventory'];
                var salenum = spec[i]['salenum'];
                var finalResult = spec[i]['finalResult'];
            %>
            <div data-ng-init="load(<%= cartAllNumber.sumNumber%>,<%= i%>,<%= price %>,<%= inventory %>,<%= salenum %>,'<%= finalResult%>','<%= limitClassify%>')"></div>
            <%}%>
            <label style="margin:5px" class="am-btn am-btn-primary-nico am-text-xs" ng-class="{'am-active':radio.isChecked==<%=i%>}">
                <input type="radio" ng-model="radio.isChecked" value="<%=i%>" name="specBtn" class="am-hide "
                       ng-click="select(<%=spec[i]['grprice']%>,<%=spec[i]['inventory']%>,<%= spec[i]['salenum']%>,'<%=spec[i]['finalResult'] %>','<%= limitClassify%>')" />
                <span class="am-navbar-label"><%= spec[i]['name']%></span>
            </label>
            <% } %>
        </div>
    </div>
    <div class="am-margin-sm" style="margin-top: 0px;"><span >价格:</span><span class='am-text-xl am-text-warning' style="top: 4px;position: relative;">￥{{price}}</span>
    </div>
    <div class="am-margin-sm">
        <span >购买数量：</span>
        <div class="display-inline-block float-right shop-cnt" style="top:-10px;position:relative;">
                <span class="minus text-center font-size-36p white detail-minus"
                       ng-click="minus()">-</span>
                <span class=" text-center  shop-num color-FF6F2E">
                    <span class="detail-datasize" ng-bind="data.size"></span>
                    </span>
                <span class="plus text-center font-size-36p white detail-plus"
                       ng-click="plus()">+</span>
        </div>
    </div>
    <div class="am-margin-sm">
        <div class="am-fl"><span ng-class="{'am-text-danger':inventory==0}">{{inventory | filterInventory}}</span></div>
        <div class="am-fr clear-right">已售 <!--{{salenum}}--> <%=product.get('saleNum')%>件</div>
    </div>
</div>
<!--图文详情及评价-->
<div data-am-widget="tabs" class="am-tabs am-tabs-default am-margin-0">
    <ul class="am-tabs-nav am-cf">
        <li class="am-active"><a href="[data-tab-panel-0]">图文详情</a></li>
        <li class=""><a href="[data-tab-panel-1]" ng-click="getComment(<%=product.id%>)">评价(<%=product.get('commentCount')%>)</a></li>
    </ul>
    <div class="am-tabs-bd">
        <div data-tab-panel-0 class="am-tab-panel am-active am-padding-0">
            <%- directPic %>
        </div>
        <div data-tab-panel-1 class="am-tab-panel ds-touch  am-margin-0">
            <article class="am-comment">
                <div ng-repeat="comment in AllComment" class="am-comment-main am-margin-sm">
                    <header class="am-comment-hd">
                        <!--<h3 class="am-comment-title">评论标题</h3>-->
                        <div class="am-comment-meta">
                            <a href="#link-to-user" class="am-comment-author">{{comment.username}}</a>
                            <span class="am-fr">评论于{{comment.dates}}</span>
                        </div>
                    </header>
                    <div class="am-comment-bd">
                        {{comment.content}}
                        <blockquote ng-if="comment.replycontent !=undefined">{{comment.replycontent}}</blockquote>
                    </div>
                </div>
                <div class="am-list-news-ft">
                    <a class="am-list-news-more am-btn am-btn-default am-margin-xs am-radius" ng-click="getComment(<%=product.id%>)" ng-disabled="commentCount >= <%=product.get('commentCount')%>">{{commentCount | isHasMore:<%=product.get('commentCount')%>}} </a>
                </div>
            </article>
        </div>

    </div>

</div>

<!---启用底部navbar-->
<div data-am-widget="navbar" class="am-navbar am-cf am-no-layout Nicolas-navbar"
     id="" ng-show="<%=isOnSale%>">
    <ul class="am-navbar-nav am-cf am-avg-sm-4">
        <div class="am-u-sm-2 am-padding-0">
            <a class="" <% if(seckill.showAddToCart && seckill.showAccount ){ %> ng-click="setCollect(<%= product.id%>)"<%}%>>
                <span class="" ng-class="{'am-icon-star':iscollect==1||(iscollect==null && <%=isCollected%>==1),'am-icon-star-o':iscollect==0||(iscollect==null && <%=isCollected%>==0)}" name="collect"></span>
                <span class="am-navbar-label" >收藏</span>
            </a>
        </div>
        <div class="am-u-sm-4 am-padding-0">
            <a href="" class="">
                <button ng-disabled="!canCart" type="button" class="am-btn am-btn-warning am-radius am-text-xs" ng-click="addToCart(<%= product.id%>)">加入购物车</button>
            </a>
        </div>
        <div class="am-u-sm-4 am-padding-0">
            <a href="" class="">
                <button ng-disabled="!canAccount" type="button" class="am-btn am-btn-danger am-radius am-text-xs" ng-click="account(<%= product.id%>)">立即结算</button>
            </a>
        </div>
        <div class="am-u-sm-2 am-padding-0">
            <a href="/cart" class="" style="position:relative;">
                <span class="am-icon-cart-plus">
                    <b  ng-if='cartNumber!=0' style="background: red no-repeat -300px 0; position:absolute; width: 20px; height: 20px; right: -2px; top: 10px; line-height:20px; text-align:center; color:#FFFFFF; border-radius: 25px;">{{cartNumber}}</b>
                </span>
                <span class="am-navbar-label">购物车</span>
            </a>
        </div>
    </ul>
</div>
    <!--loading 模态框-->
    <div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="my-modal-loading">
        <span class="am-icon-spinner am-icon-spin"></span>
    </div>
</div>

<!--如果本页面有额外的js文件/代码需要加入到head中 使用如下代码-->
<% block('footer').append('<script src="'+CDN+'script/product.js"></script>') %>
